package com.bkgy.modular.tbVoiceAlarm.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.tbVoiceAlarm.service.TbVoiceAlarmService;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @author
 * @version 1.0
 * @ClassName TbVoiceAlarmController
 * @date 2023/6/19 10:03
 */
@RestController
@RequestMapping("/tbVoiceAlarm")
public class TbVoiceAlarmController {

    @Resource
    private TbVoiceAlarmService tbVoiceAlarmService;

    @PostMapping("/findByData")
    public ResultData findByData(@RequestBody JSONObject jsonObject) {
        return tbVoiceAlarmService.findByData(jsonObject);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx")
    public void export(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        tbVoiceAlarmService.export(jsonObject,response);
    }
}
